import { reqPost, reqGet } from '@/api/request'

/** 获取视频页全部已通过审核的视频数据 */
export const getAllVideo = (paramObj: { showCount: number, currentPage: number }) => {
  return reqGet('/sjsp/getMediaList', {
    ...paramObj
  })
}

/** 获取首页中奖墙数据 */
export const getAwardBoardData = (count: string) => {
  return reqPost('/sjsp/getRewardRecordByNum', {
    count
  })
}

/** 获取榜单数据
 * @param userId 用户id（可为''代表未登录）
 */
export const getRankData = (userId: string) => {
  return reqPost('/sjsp/accountRank', {
    USER_ID: userId
  })
}

/** 领取奖励 */
export const receiveMoney = () => {
  return reqPost('/sjsp/receiveMoney')
}

/** 获取我的视频数据
 * @param type 我的视频类型： 0 -> 待审核；1 -> 已通过；2-> 未通过
 */
export const getMyVideo = (paramObj: { type: string, currentPage: string, showCount: string }) => {
  return reqPost('/sjsp/myMediaList', {
    ...paramObj
  })
}

/** 根据视频id获取视频详情 */
export const getDetailByVideoId = (id: string) => {
  return reqGet(`/sjsp/getMediaDetail/${id}`)
}

/** 获取奖励明细、提现记录等数据 */
export const moneyDetailList = (type: string) => {
  return reqPost('/sjsp/userRecord', {
    type
  })
}

/** 获取奖池信息（获奖人数、剩余金额、已发金额等） */
export const getAwardInfo = () => {
  return reqGet('/sjsp/getRewardInfo')
}

/** 获取分享季活动规则 */
export const getSpsjRule = () => {
  return reqGet('/sjsp/getRule')
}
